BGSOUNDNN n/a   IE 4   DOM n/a

A BGSOUND element defines a sound file that is to play in the background while the user visits the page. Set properties to control the volume and how many times the sound track plays even after the sound file has loaded. A few properties, such as innerHTML and innerText, are exposed in the Windows version, but they don't apply to an element that does not have an end tag.

 
HTML Equivalent
<BGSOUND>
 
Object Model Reference
IE [window.]document.all.elementID
balanceNN n/a   IE 4   DOM n/a
 Read-only
 

How the audio is divided between the left and right speakers. Once this attribute value is set in the element, its value cannot be changed by script control.

 
Example
var currBal = document.all.tags("bgsound")[0].balance
 
Value
A signed integer between -10,000 and +10,000. A value of is equally balanced on both sides. A negative value means the left side is dominant; a positive value means the right side is dominant.
 
Default 0
loopNN n/a   IE 4   DOM n/a
 Read/Write
 

The number of times the sound plays. Assigning a value of -1 means the sound plays continuously until the page is unloaded.

 
Example
document.all.mySound.loop = 3
 
Value
Integer.
 
Default -1
srcNN n/a   IE 4   DOM n/a
 Read/Write
 

URL of the sound file to be played. Change tunes by assigning a new URL to the property.

 
Example
document.all.tune.src = "sounds/blues.aif"
 
Value
Complete or relative URL as a string.
 
Default None.
volumeNN n/a   IE 4   DOM n/a
 Read-only
 

How loud the background sound plays relative to the maximum sound output level as adjusted by user preferences in the client computer. Maximum volume--a setting of zero--is only as loud as the user has set the Sound control panel. Attribute adjustments are negative values as low as -10,000 (although most users lose the sound at values much higher than that value).

 
Example
var currVolume = document.all.themeSong.volume
 
Value
Integer.
 
Default Varies with operating system and sound settings.